package com.uuah.server.config.spring.parsers.specific;

import com.uuah.api.config.IThreadingProfile;
import com.uuah.config.ChainedThreadingProfile;
import com.uuah.server.config.spring.parsers.generic.OrphanDefinitionParser;
import com.uuah.server.config.spring.parsers.processors.IdAttribute;
import com.uuah.server.config.spring.parsers.processors.NameAttribute;

/**
 * This parser is responsible for processing the
 * <code><threading-profile><code> configuration elements.
 */
// shouldn't this extend UuahOrphanDefinitionParser?
public class DefaultThreadingProfileDefinitionParser extends
		OrphanDefinitionParser {

	public DefaultThreadingProfileDefinitionParser(String propertyName) {
		super(ChainedThreadingProfile.class, true);
		addMapping("poolExhaustedAction",
				IThreadingProfile.POOL_EXHAUSTED_ACTIONS);
		registerPostProcessor(new IdAttribute(propertyName));
		registerPostProcessor(new NameAttribute(propertyName));
	}

}